// VBConversions Note: VB project level imports
using System.Data;
using DevExpress.XtraEditors.Controls;
using System.Diagnostics;
using System.Xml.Linq;
using DevExpress.XtraEditors.Repository;
using System.Collections.Generic;
using System.Data.SqlClient;
using Microsoft.VisualBasic;
using System.Configuration;
using System.Collections;
using DevExpress.XtraEditors;
using System.Data.Sql;
using Microsoft.SqlServer;
using System.Windows.Forms;
using System;
using DevExpress.XtraReports;
using Microsoft.SqlServer.Management.Smo;
using DevExpress;
using System.Linq;
using System.IO;
// End of VB project level imports


namespace SCIEF.SysBFW.CommonExt
{
	namespace Utils
	{
		public sealed class Util
		{
			/// <summary>
			/// Get a Control in a collection of Controls (recursively)
			/// </summary>
			/// <param name="name">Name of the control to find</param>
			/// <param name="rootControl">Root control where to look for</param>
			/// <returns></returns>
			/// <remarks>Be carefull it will return the first control with that name</remarks>
			public static Control GetControlByName(string name, Control rootControl)
			{
				//
				if (rootControl.Name == name)
				{
					return rootControl;
				}
				//
				foreach (Control Ctl in rootControl.Controls)
				{
					Control FoundCtl = GetControlByName(name, Ctl);
					if (FoundCtl != null)
					{
						return FoundCtl;
					}
				}
				//
				return null;
			}
		}
	}
	
}
